#include <iostream>
#include <time.h>
#include <thread>
#include <chrono>
#include <sys/time.h>
#include <vector>
#include <cuda.h>
#include <sys/time.h>
#include <typeinfo>
#include <iostream>
#include <chrono>
using namespace std;

const int size = 7853052 * 65, thread_size = 4;
int k[size];

void countnumber(int id, int* k) {
    register auto group_sz = 8;
	// for (unsigned int i = id; i < 7853052; i += thread_size) {
    //     for (register int j = 0; j < 65; j++) {
    //         k[i * 65 + j] = 8156;
    //     }
    // }
	// cout << "Thread " << id << " finished!" << endl;
}

int main() {
	thread th[thread_size];    

    int a = 0;
    int *C = &a;
    std::cout << (*C);
	std::chrono::high_resolution_clock::time_point t1 = std::chrono::high_resolution_clock::now();
    for(int k = 0; k < 10; k++) {
        for (int i = 0; i < thread_size; i++)
            th[i] = thread(countnumber, i, C);
        for (int i = 0; i < thread_size; i++)
            th[i].join();
    }

	std::chrono::high_resolution_clock::time_point t2 = std::chrono::high_resolution_clock::now();
    
    std::cout<<std::chrono::duration_cast<std::chrono::milliseconds>(t2-t1).count()<<std::endl;

	return 0;
}